/*
 * $Id: MixedStreamReader.java,v 1.2 2009/07/24 18:34:01 oliver Exp $
 *
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 *
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */

package org.simplx.xstream;

import com.thoughtworks.xstream.io.HierarchicalStreamReader;

import java.util.Iterator;

/**
 * A stream reader that handles mixed text and XML content.
 *
 * @author Ken Arnold
 */
public interface MixedStreamReader extends HierarchicalStreamReader {
    /** An XML node part of the mixed stream. */
    interface NodePart {
        /**
         * Returns the name of the node.
         *
         * @return The name of the node.
         */
        String nodeName();
    }

    /** A text part of the mixed stream. */
    interface TextPart {
        /**
         * Returns the text of this part of the stream.
         *
         * @return The text of this part of the stream.
         */
        String contents();
    }

    /**
     * Returns an iterator that goes through the parts of mixed content.
     *
     * @return An iterator that walks through a sequence of {@link NodePart} and
     *         {@link TextPart} nodes.
     */
    Iterator partIterator();
}
